package com.sanda.androidcourse.strategy.mvp;

import com.sanda.androidcourse.strategy.model.CalculatorModel;

// Presenter
public class CalculatorPresenter {
    private CalculatorView view;
    private CalculatorModel model;

    public CalculatorPresenter(CalculatorView view) {
        this.view = view;
        this.model = new CalculatorModel();
    }

    public void onAddClicked() {
        int a = view.getNum1();
        int b = view.getNum2();
        int result = model.add(a, b);
        view.showResult(result);
    }
}
